package com.ikas.ai.server.module.flow.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ikas.ai.server.module.flow.dao.FlowDAO;
import com.ikas.ai.server.module.flow.enums.NodeConfigSymbol;
import com.ikas.ai.server.module.flow.model.Flow;
import org.springframework.stereotype.Service;

/**
 * @Description: 流程Service
 *
 * @Author: qi.yilai
 * @Date: 2023/1/17 16:14
 * @Version: 1.0.0
 **/
@Service
public class FlowService extends ServiceImpl<FlowDAO, Flow> {


    /**
     * 根据场景获取id获取流程
     *
     * @param sceneId
     * @return
     */
    public Flow getFlowBySceneId(Long sceneId) {
        LambdaQueryWrapper<Flow> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(Flow::getSceneId, sceneId);
        return getOne(lambdaQueryWrapper);
    }
}
